C programming


Q1.

Consider the following C program: #include < stdio.h > int main() { int a[] = {2, 4, 6, 8, 10}; int i, sum = 0, *b = a + 4; for (i = 0; i < 5; i++ ) sum = sum + (*b - i) - *(b - i); printf("%dn", sum); return 0; } The output of above C program is __________ . Note: This was Numerical Type question.
GateOverflow

Q2.

Consider the following C program: #include < stdio.h > int main() { float sum = 0.0, j = 1.0, i = 2.0; while (i / j > 0.0625) { j = j + j; sum = sum + i/j; printf("%f \n", sum); } return 0; } The number of times variable sum will be printed When the above program is executed is _________ .
GateOverflow